package com.le.tester.javaThink.fifth.chapter12_Collections;

import java.util.ArrayDeque;
import java.util.Deque;

/**
 * createTime：2021/8/30 10:58
 * description：StackTest,似乎还能做一个倒叙，但是性能好像很差
 */
public class StackTest {
    public static void main(String[] args) {

        Deque<String> stack = new ArrayDeque<>();
        for (String s : "My dog has fleas".split(" ")) {
            stack.push(s);
        }
//        System.out.println(stack);
        while (!stack.isEmpty()) {
            System.out.println(stack.pop() + " ");
        }
    }
}
